<template>
  <div>
    <!-- search -->
    <van-search placeholder="请输入搜索关键词" v-model="txt" />
    <!-- shopListBody -->
    <shopListBody v-show="searchFlag" :keywords="txt"></shopListBody>
    <!-- tabbar -->
    <tabbar></tabbar>
  </div>
</template>

<script>
import shopListBody from '../home/shopListBody'
import tabbar from '../tabbar/tabbar'
export default {
  data() {
    return {
      txt: '',
      searchFlag: false 
    }
  },
  methods: {

  },
  components: {
    tabbar,
    shopListBody
  },
  watch: {
    'txt'(newVal) {
      if (newVal != '') {
        this.searchFlag = true
      } else {
        this.searchFlag = false
      }
    }
  }
}
</script>

<style lang="less" scoped>

</style>
